<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<video id="video" width="300" height="200"controls>
			<source src="mov.mp4"></source>
		</video>
		<br />
		<canvas id="canvas" width="300" height="200"></canvas>
	</body>
	<script type="text/javascript">
		var context = document.getElementById("canvas").getContext("2d");
		var video = document.getElementById("video");
		var timer;
		function play(){
			timer = window.setInterval(function(){
				context.drawImage(video,0,0);
			},20);
		}
		function pause(){
			window.clearInterval(timer);
		}
		function ended(){
			window.clearInterval(timer);
			
		}
		video.addEventListener("play",play,false);
		video.addEventListener("pause",pause,false);
		video.addEventListener("ended",ended,false);
	</script>
</html>
